import fetch from '@/config/fetch'


/**
 * 公司注册
 */
export const regester = data => fetch('/api/Company/Auth/Reg', data, 'POST');
/**
 * 用户注册
 */
export const memberRegester = data => fetch('/api/Member/Auth/Reg', data, 'POST');
/**
 * 公司登陆
 */
export const login = data => fetch('/api/Company/Auth/Login', data, 'POST');
/**
 * 用户登录
 */
export const memberLogin = data => fetch('/api/Member/Auth/Login', data, 'POST');
//获取行业
export const GetHy = () => fetch('/api/Common/Common/GetHy');
//获取薪资
export const GetJobMoneyList = () => fetch('/api/Common/Common/GetJobMoneyList');
//获取年限
export const GetJobYearList = () => fetch('/api/Common/Common/GetJobYearList');
//获取职业类别
export const GetJobTypeList = () => fetch('/api/Common/Common/GetJobTypeList');
//获取学历
export const GetEduList = () => fetch('/api/Common/Common/GetEduList');
//公司搜索简历
export const SearchResumeList = data => fetch('/api/Company/Job/SearchResumeList',data,'post');
//获取职务和简历数量
export const GetJobList = () => fetch('/api/Company/Job/GetJobList');
//获取公司性质
export const GetCompanyProp = () => fetch('/api/Common/Common/GetCompanyProp');
//更新公司信息
export const UpdateCompanyInfo = data=> fetch('/api/Company/Home/UpdateCompanyInfo',data,'post');
//获取公司信息
export const GetCompanyInfo = data=> fetch('/api/Company/Home/GetCompanyInfo');
//更改手机号
export const UpdateCompanyPhone = data=> fetch('/api/Company/Home/UpdateCompanyPhone',data,'post');
//更改密码
export const UpdateCompanyPass = data=> fetch('/api/Company/Home/UpdateCompanyPass',data,'post');
//更改邮箱
export const UpdateCompanyEmail = data=> fetch('/api/Company/Home/UpdateCompanyEmail',data,'post');
//更新短信辅助手机号
export const UpdateCompanyAssistPhone = data=> fetch('/api/Company/Home/UpdateCompanyAssistPhone',data,'post');


/**
 * 以下不是
 */
/**
 * 退出测试
 */
export const signout = () => fetch('/admin/signout');

/**
 * 获取用户信息
 */

export const getAdminInfo = () => fetch('/admin/info');

/**
 * api请求量
 */

export const apiCount = date => fetch('/statis/api/' + date + '/count');

/**
 * 所有api请求量
 */

export const apiAllCount = () => fetch('/statis/api/count');


/**
 * 所有api请求信息
 */

export const apiAllRecord = () => fetch('/statis/api/all');

/**
 * 用户注册量
 */

export const userCount = date => fetch('/statis/user/' + date + '/count');

/**
 * 某一天订单数量
 */

export const orderCount = date => fetch('/statis/order/' + date + '/count');


/**
 * 某一天管理员注册量
 */

export const adminDayCount = date => fetch('/statis/admin/' + date + '/count');

/**
 * 管理员列表
 */

export const adminList = data => fetch('/admin/all', data);

/**
 * 管理员数量
 */

export const adminCount = () => fetch('/admin/count');

/**
 * 获取定位城市
 */

export const cityGuess = () => fetch('/v1/cities', {
	type: 'guess'
});

/**
 * 添加商铺
 */

export const addShop = data => fetch('/shopping/addShop', data, 'POST');

/**
 * 获取搜索地址
 */

export const searchplace = (cityid, value) => fetch('/v1/pois', {
	type: 'search',
	city_id: cityid,
	keyword: value
});

/**
 * 获取当前店铺食品种类
 */

export const getCategory = restaurant_id => fetch('/shopping/getcategory/' + restaurant_id);

/**
 * 添加食品种类
 */

export const addCategory = data => fetch('/shopping/addcategory', data, 'POST');


/**
 * 添加食品
 */

export const addFood = data => fetch('/shopping/addfood', data, 'POST');


/**
 * category 种类列表
 */

export const foodCategory = (latitude, longitude) => fetch('/shopping/v2/restaurant/category');

/**
 * 获取餐馆列表
 */

export const getResturants = data => fetch('/shopping/restaurants', data);

/**
 * 获取餐馆详细信息
 */

export const getResturantDetail = restaurant_id => fetch('/shopping/restaurant/' + restaurant_id);

/**
 * 获取餐馆数量
 */

export const getResturantsCount = () => fetch('/shopping/restaurants/count');

/**
 * 更新餐馆信息
 */

export const updateResturant = data => fetch('/shopping/updateshop', data, 'POST');

/**
 * 删除餐馆
 */

export const deleteResturant = restaurant_id => fetch('/shopping/restaurant/' + restaurant_id, {}, 'DELETE');

/**
 * 获取食品列表
 */

export const getFoods = data => fetch('/shopping/v2/foods', data);

/**
 * 获取食品数量
 */

export const getFoodsCount = data => fetch('/shopping/v2/foods/count', data);


/**
 * 获取menu列表
 */

export const getMenu = data => fetch('/shopping/v2/menu', data);

/**
 * 获取menu详情
 */

export const getMenuById = category_id => fetch('/shopping/v2/menu/' + category_id);

/**
 * 更新食品信息
 */

export const updateFood = data => fetch('/shopping/v2/updatefood', data, 'POST');

/**
 * 删除食品
 */

export const deleteFood = food_id => fetch('/shopping/v2/food/' + food_id, {}, 'DELETE');

/**
 * 获取用户列表
 */

export const getUserList = data => fetch('/v1/users/list', data);

/**
 * 获取用户数量
 */

export const getUserCount = data => fetch('/v1/users/count', data);

/**
 * 获取订单列表
 */

export const getOrderList = data => fetch('/bos/orders', data);

/**
 * 获取订单数量
 */

export const getOrderCount = data => fetch('/bos/orders/count', data);

/**
 * 获取用户信息
 */

export const getUserInfo = user_id => fetch('/v1/user/' + user_id);

/**
 * 获取地址信息
 */

export const getAddressById = address_id => fetch('/v1/addresse/' + address_id);

/**
 * 获取用户分布信息
 */

export const getUserCity = () => fetch('/v1/user/city/count');
